find the inverse of the function